package cn.lg.soar.system.feign;


import cn.lg.soar.core.annotations.ApiClient;
import cn.lg.soar.system.api.constant.ModuleConst;
import cn.lg.soar.system.api.model.NoticeDTO;
import cn.lg.soar.system.api.service.INoticeApi;
import cn.lg.soar.system.feign.fallback.NoticeApiFallbackFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author luguoxiang
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@ConditionalOnMissingClass("cn.lg.soar.system.biz.modules.message.client.NoticeApiClient")
@ApiClient
@FeignClient(
        name= ModuleConst.MODULE_NAME,
        path= ModuleConst.CLIENT_PATH + "/notice",
        fallbackFactory= NoticeApiFallbackFactory.class,
        contextId = "NoticeApiFeign"
)
public interface NoticeApiFeign extends INoticeApi {

    @PostMapping("broadcast")
    @Override
    void broadcast(@RequestBody NoticeDTO dto);

    @PostMapping("toUser")
    @Override
    void toUser(NoticeDTO dto, @RequestBody List<Long> userIds);

}
